package gjtx3;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class SetMethod {
    public static void main(String[] args) {
        Set set=new HashSet();
        set.add(111);
        set.add(222);
        System.out.println(set.size());
        Set set1=new HashSet();
        set1.add("aaa");
        set1.add("bbb");
        set1.add("ccc");
        set.addAll(set1);
        System.out.println(set);
        Iterator ir=set.iterator();
        while (ir.hasNext()){
            System.out.println(ir.next()+" ");
        }

    }
}
